package cate.game.role.pvp.minecraft.msg;

import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdMinecraft;
import easy.java.practice.errorcode.EcResult;

@ClientMsg(title = "矿洞争霸-挑战区 升级主城 请求")
public class MinecraftChallengeLevelUpReq implements MsgInput {
    @Override
    public MsgConfig conf() {
        return MsgIdMinecraft.MINECRAFT_CHALLENGE_LEVEL_UP_REQ;
    }

    @Override
    public void execute(GameBody game, ClientContext cc) {
        EcResult<Void> r = cc.getRole().getPvp().minecraft.challengePO.levelUp();
        if (r.ok()) {
            cc.getRole().getPvp().minecraft.challengePO.noticeUpdate();
        } else {
            game.notice.message(cc.getRole(), r);
        }
    }
}
